package com.jrtc.base.util.token;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

public class TokenUtil {

    //根据账号密码  IP  有效期 生成token
    public String getToken(String account, String password) {
        String token="";
        token= JWT.create().withAudience(account)
                .sign(Algorithm.HMAC256(password));
        return token;
    }

    public static void main(String []args){
        TokenUtil tokenUtil=new TokenUtil();
        System.out.println(tokenUtil.getToken("wy","wy"));
    }
}
